<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>

<body>
    <div id="app">

        <!--  v-if  分支指令 -->

        <div v-if='flag'> 出去吃烧烤</div>

        <div v-else> 在家敲代码</div>

        <button @click='flag=!flag'>点击切换</button>

        <ul>
            <li v-if='score>=90'> 爸爸奖励一辆自行车</li>
            <li v-else-if='score < 90 &&   score>=80'> 奖励一个棒棒糖</li>
            <li v-else> 奖励 暴揍一顿</li>
        </ul>
        {{score}}

        <button @click='score++'>点击++</button>

    <!--  v-show  显示与隐藏  是通过样式 -->
        <h1 v-show='isShow'>  你看到到我吗</h1>

    <button @click='changeIsShow'>  changeIsShow</button>
        

        <button @click='isShow=!isShow'  >点击 isShow</button>

    </div>
    <script src="./vue.js"></script>
    <script>
        var vm = new Vue({
            el: '#app',
            data: {
                flag: true,
                score: 70,
                isShow:false
            },
            methods: {
                changeIsShow() {
                    this.isShow=!this.isShow
                }
            }
        });
    </script>
</body>

</html>